# include <bits/stdc++.h>
// Vnode 表示顶点结点,ArcNode 表示边结点
# include "adjacentList.h"
// EnQueue：入队,Dequeue: 出队
# include "QueueTest.h"
# define MaxVNum 10
using namespace std;

int *visited  = new int[MaxVNum]();

VNode AdjList[MaxVNum];
vector<VNode> graph;
void dfs(vector<VNode> &g,int i)
{
    
    visited[i] = 1;
    cout << g[i].data;
    for(ArcNode *p=g[i].firstarc;p;p=p->nextarc)
    {
        if(visited[p->adjvex]==0)
            dfs(g,p->adjvex);
    }
}
void DFSTraves(vector<VNode> &g)
{
    int n = g.size();
    for(int i=0;i<n;i++)
    {
        if(visited[i]==0)
            dfs(g,i);
    }
}